﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Twitter.Tests;
using Twitter;

namespace FriendsNearbyBot.Tests
{
    [TestFixture]
    public class HiProcessorFixture : TestBase
    {
        [Test]
        public void ShouldSendHelloIfHiIsSend()
        {
            MemoryBotClient bot = new MemoryBotClient("fnbtesta");
            MemoryBotClient user = new MemoryBotClient("fnbtestb");
            bot.SetBuddy(user);
            user.SetBuddy(bot);

            HiProcessor processor = new HiProcessor(CreateMessageBuilder());

            RunNextProcessor result;
            result = processor.Process(bot, CreateMessage("hi", user.ScreenName, bot.ScreenName));

            Assert.AreEqual(RunNextProcessor.No, result);
            Assert.AreEqual(1, user.Messages.GetAll().Count());
            Assert.AreEqual(Properties.Resources.HiMessage, user.Messages.GetAll().First().Text);

        }
        [Test]
        public void ShouldSendHelloIfHelloIsSend()
        {
            MemoryBotClient bot = new MemoryBotClient("fnbtesta");
            MemoryBotClient user = new MemoryBotClient("fnbtestb");
            bot.SetBuddy(user);
            user.SetBuddy(bot);

            HiProcessor processor = new HiProcessor(CreateMessageBuilder());


            RunNextProcessor result;
            result = processor.Process(bot, CreateMessage("HellO", user.ScreenName, bot.ScreenName));

            Assert.AreEqual(RunNextProcessor.No, result);
            Assert.AreEqual(1, user.Messages.GetAll().Count());
            Assert.AreEqual(Properties.Resources.HiMessage, user.Messages.GetAll().First().Text);

        }
    }
}
